<h2><%= t 'cartasur.menu.uploaddocuments' %></h2>
<% if flash[:error] %>
    <div class="flash error"><p><%= flash[:error] %></p></div>
<% end %>
<% if flash[:notice] %>
    <div class="flash notice"><p><%= flash[:notice] %></p></div>
<% end %>
<div class="intro-cartasur">
  <p><%= t 'cartasur.uploads.uploadeddocssummary' %></p>
</div>
<br />
<% unless @docs.blank? %>
    <div id="forums">
  <% @docs.each{ |doc| %>
  <div>
    <div class="cartasur-post">
      <span class="left" style="vertical-align: middle; text-align: center; border-bottom: thin dotted darkgrey ">
        <a href="<%= doc.document %>" target="_blank"><img src="/images/icons/download_512.png" alt="Download" style="height: 60px; width: 60px; " /> </a>
        <br /><%= t 'cartasur.uploads.uploadedby' %><br /><%= doc.user.login %>
      </span>
      <span class="right">
      <%= t 'cartasur.uploads.filename' %>:
      <p><a href="<%= doc.document %>" target="_blank"><%= File.basename(doc.document.path) %></a></p>
        <%= t 'cartasur.uploads.details' %>: <p><%= doc.details %></p>
        <% if admin? %>
            <%= link_to (t 'cartasur.forums.destroy'), "homepage/removedoc?doc=#{doc.id}", :confirm => (t 'cartasur.forums.areyousure') %>
        <% end %>
      </span>
    </div>
  </div>
   <% } %>
</div>
<br />
<% else %>
    <div class="intro-cartasur">
      <p><%= t 'cartasur.uploads.nouploadeddocs' %></p>
    </div>  <br />
<% end %>

<% if adminorpartner? %>
<h3><%= t 'cartasur.uploads.uploadadocument' %></h3>
    <br />
<%= form_for(@new_upload, :html => { :multipart => true }, :url => {:action => "uploaddoc", :user=> current_user.id}) do |f| %>
   <fieldset class="intro"> <p><%= f.label :document, :class => "form_text_field_label" %>: <%= f.file_field :document %></p>

        <p><%= f.label :details, :class => "form_text_field_label" %>: <%= f.text_area :details, :class => "form_text_field", :rows => 3, :style => "vertical-align: top;"%></p>

        <p style="margin-left: 65px;"><%= f.submit("Upload document") %></p>
   </fieldset>
<% end -%>

<% end %>